/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.io.Serializable;

/**
 *
 * @author ThanhToan
 */
public class UserModel implements Serializable{
    private static final long serialVersionUID = 1L;
    private String userID;
    private String username;
    private String password;
    private String address;
    private String phone;
    private String email;
    private String firstname;
    private String lastname;
    private String accountType;
    private String salt;
    private String day;
    private String month;
    private String year;

    public String getDay() {
        return day;
    }

    public void setDay(String day) {
        this.day = day;
    }

    public String getMonth() {
        return month;
    }

    public void setMonth(String month) {
        this.month = month;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getAccountType() {
        return accountType;
    }

    public void setAccountType(String accountType) {
        this.accountType = accountType;
    }

    public String getUserID() {
        return userID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getLastname() {
        return lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public boolean validate(){
        boolean result = true;

        if(username.trim().length() < 6 || username.trim().length() >20 ){
            result = false;
        }
        if(password.trim().length() < 6 || password.trim().length() >20 ){
            result = false;
        }
        if(firstname == null || firstname.trim().equals("")){
            result = false;
        }
        if(lastname == null || lastname.trim().equals("")){
            result = false;
        }
        if(email == null || email.trim().equals("")){
            result = false;
        }
        return result;
    }

}
